package com.onekbase.demo.spring.bean;

import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.context.*;
import org.springframework.core.env.Environment;
import org.springframework.core.io.ResourceLoader;
import org.springframework.util.StringValueResolver;

public class SubLifeBean extends LifeBean implements BeanClassLoaderAware,
        EnvironmentAware, EmbeddedValueResolverAware, ResourceLoaderAware,
        ApplicationEventPublisherAware,MessageSourceAware{

    private String subName;

    public SubLifeBean(){
        System.out.println("SubLifeBean Initializing ");
    }

    public String getSubName() {
        return subName;
    }

    public void setSubName(String subName) {
        System.out.println("setSubName:"+subName);
        this.subName = subName;
    }

    public void setBeanClassLoader(ClassLoader classLoader) {
        System.out.println("SubLifeBean.setBeanClassLoader invoke");
    }

    public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
        System.out.println("SubLifeBean.setApplicationEventPublisher invoke");
    }

    public void setEmbeddedValueResolver(StringValueResolver resolver) {
        System.out.println("SubLifeBean.setEmbeddedValueResolver invoke");
    }

    public void setEnvironment(Environment environment) {
        System.out.println("SubLifeBean.setEnvironment invoke");
    }

    public void setMessageSource(MessageSource messageSource) {
        System.out.println("SubLifeBean.setMessageSource invoke");
    }

    public void setResourceLoader(ResourceLoader resourceLoader) {
        System.out.println("SubLifeBean.setResourceLoader invoke");
    }

    @Override
    public String toString() {
        return "SubLifeBean{" +
                "subName='" + subName + '\'' +
                '}';
    }
}
